<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Map-Object</title>
</head>

<body>
    <script>
        // let m = new Map([
        //     ['2', '2222'],
        //     ['3', '3333'],
        //     ['1', '1111'],
        //     ['4', '4444']
        // ]);

        // for (let v of m) {
        //     console.log(v);
        // }

        const obj99 = {};
        for (let i = 0; i < 1000 * 1000; i++) {
            obj99[i + ''] = i;
        }
        // console.time('obj find');
        // obj99['200000'];
        // console.timeEnd('obj find');

        console.time('obj delete');
        delete obj99['200000'];
        console.timeEnd('obj delete');

        const m999 = new Map();
        for (let i = 0; i < 1000 * 1000; i++) {
            m999.set(i, i);
        }
        // console.time('map find');
        // m999['200000'];
        // console.timeEnd('map find');



        console.time('map delete');
        delete obj99['200000'];
        console.timeEnd('map delete');

    </script>
</body>

</html>